package enemies.factory.builders;

import java.util.Random;

import modelLoader.ModelLoader;

import com.jme.scene.Node;

import enemies.strategy.concretes.ConcreteStrategyLow;
/*
* Clase creadora de enemigos Rugulus 
* @ implements Runnable
* @ author Sebastian Giulietti 69032 
* @ author Adrian Sanchez 64251
*/
public class RugulusEnemyBuilder extends EnemyBuilder {

	@Override
	public void asignarEstrategia() {
		//Asigna una estrategia que usaran los Altair que sean creados despues

		getEnemy().setStrategy(new ConcreteStrategyLow(mapControl, enemy));
	}

	@Override
	//Crear el modelo asignado 
	public void buildModel() {

		Node model = ModelLoader.getRugulusModel();

		model.setLocalScale(.7f);
		model.setLocalTranslation(0, 2, 0);

		getEnemy().getNode().attachChild(model);

	}

	@Override
	public void buildTexture() {
		// TODO Auto-generated method stub

	}

	@Override
	//Posiciona a un Rugulus en la posicion aleatoria
	public void locate() {

		Random rnd = new Random();

		int row = rnd.nextInt(mapControl.getWide() - 5) + 5;
		int col = rnd.nextInt(mapControl.getHight() - 5) + 5;

		while (!mapControl.isEmpty(row, col)) {
			row = rnd.nextInt(mapControl.getWide());
			col = rnd.nextInt(mapControl.getHight());
		}

		getEnemy().locate(row, col);

	}

	@Override
	//Setea el nombre
	public void setName() {
		getEnemy().setName("Rugulus");
		getEnemy().setScore(15);

	}

}
